package create.prototype;

import java.io.IOException;

public class PrototypeTest {
	public static void main(String[] args) throws CloneNotSupportedException, ClassNotFoundException, IOException {
		// 抽象工厂方法
		Prototype proto = new Prototype();
		Object clone1 = proto.shallowClone();
		Object clone2 = proto.deepClone();
		System.out.println("比较浅拷贝对象："+(proto.getObject() == ((Prototype)clone1).getObject()));
		System.out.println("比较深拷贝对象："+(proto.getObject() == ((Prototype)clone2).getObject()));
	}
}
